
package com.joysuch.wwyt.risk.service;

import com.joysuch.wwyt.bp.bean.BpBaseUserBean;
import com.joysuch.wwyt.core.bean.SimpleSelectListBean;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.risk.bean.*;
import com.joysuch.wwyt.risk.entity.RiskDistrict;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface RiskDistrictService {

    public void add(RiskDistrictSaveBean districtBean) throws Exception;

    void update(RiskDistrictSaveBean districtBean) throws Exception;

    Page<RiskDistrict> findByPage(Pageable page, RiskDistrictListSearchBean condition);

    /**
     * 找出所有拥有点位的风险区域
     * @return
     */
    List<RiskDistrict> findAllHaveLocation();

    void delete(Long id) throws ApiBusinessException;

    public RiskDistrict findById(Long id);

    public String findDistrictNameById(Long id);

    Page<RiskDistrictStableRiskListBean> findByPage(Pageable page, RiskDistrictStableRiskListSearchBean condition);

    // 区域是否评估列表，
    Page<RiskDistrictEvaluationListBean> findDistrictEvluationByPage(Pageable page, Integer evaluationState);

    // 查询区域固有风险评估详情
    public RiskDistrictStableRiskQueryBean findStableRiskEvaluationDetail(Long disctrictId, boolean searchHistory);

    /**
     * 更新区域风险级别。
     * 在区域评估、区域内的风险点评估后，需要更新区域风险级别。如果级别升高，则产生预警消息
     *
     * @param districtId
     *            区域ID
     * @return 当前风险级别
     */
    public Integer updateDistrictRiskLevel(Long districtId);

    ResultBean levelSpread();

    List<SimpleSelectListBean> getDistrictSimpleList();

    void deleteByList(LongListBean bean);

    ResultBean riskAreaSum();

    List<RiskDistrict> findByResponsibleDept();

    /**
     * 获取拥有位置的区域数量
     * flag  0 : 所有数量 1: 拥有位置的数量
     * @return
     */
    Long getNumForHaveLocation(Integer flag);

    List<BpBaseUserBean> getResponsibleAndHelpers(Long id);
}
